package com.sljy.hzk.net.service;

import com.sljy.hzk.entity.ExamInfosEntity;
import com.sljy.hzk.entity.ExamMainEntity;
import com.sljy.hzk.entity.ExamSubmitEntity;
import com.sljy.hzk.entity.HiddenDangerDetalisEntity;
import com.sljy.hzk.entity.TaskCountEntity;
import com.sljy.hzk.entity.TaskDetailEntity;
import com.sljy.hzk.entity.TaskMainEntity;
import com.sljy.hzk.net.CommonResult;

import java.util.List;
import java.util.Map;

import io.reactivex.Observable;
import okhttp3.MultipartBody;
import okhttp3.RequestBody;
import retrofit2.Call;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.Part;
import retrofit2.http.PartMap;

/**
 * Created  on 2018/7/4 0004
 *
 * @author 唐开阔
 * @describe 任务
 */
public interface TaskService {

    @FormUrlEncoded
    @POST("myTask/index.do")
    Observable<CommonResult<TaskMainEntity>> getTaskByDate(@Field("cpId") long cpId, @Field("pId") long pId, @Field("date") String date);

    @FormUrlEncoded
    @POST("myTask/detail.do")
    Observable<CommonResult<List<TaskDetailEntity>>> getTaskDetail(@Field("workPlanId") int  workPlanId);

    /**
     * 解锁任务
     */
    @FormUrlEncoded
    @POST("myTask/deblocking.do")
    Call<CommonResult<String>> UnlockTask(@Field("partitionId") int partitionId, @Field("wId") int wId, @Field("date") String date);

    /**
     * 上传图片
     */
    @Multipart
    @POST("myTask/picture.do")
    Call<CommonResult<String>> upPicture(@Part() MultipartBody.Part part);

    /**
     * 隐患上传图片
     */
    @Multipart
    @POST("myTask/picture.do")
    Call<CommonResult<String>> upPictureX(@Part() MultipartBody.Part part);

    /**
     * 提交任务
     * @param cpId
     * @return
     */
    @FormUrlEncoded
    @POST("myTask/submit.do")
    Observable<CommonResult<Object>> submit(@Field("workPlanId") int workPlanId, @Field("cpId") long cpId, @Field("templates")String templates, @Field("dealPerson") String name);


    /**
     * 获取隐患详情
     * @return
     */
    @FormUrlEncoded
    @POST("myTask/dealMethod.do")
    Observable<CommonResult<HiddenDangerDetalisEntity>> getHiddenDanger(@Field("dangerId") int dangerId);
    /**
     * 解决隐患
     * @return
     */
    @FormUrlEncoded
    @POST("myTask/submitResult.do")
    Observable<CommonResult<Object>> submitHiddenDanger(@Field("dangerId") int dangerId,@Field("result") String result);

    /**
     * 解决隐患
     * @return
     */
    @FormUrlEncoded
    @POST("myTask/submitResult.do")
    Observable<CommonResult<Object>> submitHiddenDanger(@Field("dangerId") int dangerId,@Field("result") String result,@Field("resultPicPath") String resultPicPath,@Field("dealPerson") String name);
}
